$(function() {
	tt.datagrid({
		url : ctx + '/getmodifymyleave',
		method : 'POST',
		pagination : true,
		rownumbers : true,
		height : 350,
		striped : true,
		pageSize:20,
		valueField : 'id',
		textField : 'name',
		idField : 'id',
		loadMsg : '正在加载数据。。。。。',
		sortName : "id",
		columns : [ [{
			field : 'id',
			title : '流程编号',
			width : 100
		},{
			field : 'name',
			title : '流程节点',
			width : 100
		},{
			field : 'createTime',
			title : '任务创建时间',
			width : 100
		},{
			field : 'businessKey',
			title : '任务操作',
			width : 100,
			formatter:function(value,row,index){
				return '<a class="btn"  onclick ="return see(\''+value+'\',\''+row.id+'\');">查看文件</a><a class="btn" href="'+ctx+'/graphHistoryProcessInstance?processInstanceId='+row.processInstanceId+'">查看进度</a><a class="btn" href="'+ctx+'/systemGraphHistoryProcessInstance?processInstanceId='+row.processInstanceId+'">查看进度</a>' ;
			}
		}] ],
		fit : true,
		pagination : true,
		rownumbers : true,
		fitColumns : true,
		singleSelect : true,
		toolbar:'#dlg-toolbar'
	});
});
function see(id,taskid){
	$("#formpasswed").attr("url",'/onemodifymyleave');
	$.post(ctx+'/getOneMyLeave',{'id':id},function(data, textStatus, jqXHR) {
		$("#formpasswed").form("load",data);
		$("#taskid").val(taskid);
		$('#win').window('open');
	},'json');
	return false;
}
function oksubmint(){
	$.post(ctx+$("#formpasswed").attr("url"),$("#formpasswed").serialize(),function(data, textStatus, jqXHR) {
		alert(data.message);
		$('#tt').datagrid('reload');
		$('#win').window('close');
	},'json');
}